export default {
  inserted: function(el, binding) {
    const input = el.getElementsByTagName('input')[0]
    input.focus()
    input.addEventListener('keyup', function(event) {
      if (event.key === 'Enter' && input.value) {
        input.blur()
        binding.value()
      }
    })
  }
}
